package main

import (
	"fmt"
	"testing"
)

func testfmt() {
	fmt.Println("=================testfmt=================")
	TestIntMinBasic(&testing.T{})
}
func IntMin(a, b int) int {
	if a < b {
		return a
	}
	return b
}
func TestIntMinBasic(t *testing.T) {
	ans := IntMin(-21, 11)
	if ans > 2 {
		t.Errorf("IntMin(2, -2) = %d; want 2", ans)
	}
}
func TestInitMinTableDriven(t *testing.T) {
	var tests = []struct {
		a, b int
		want int
	}{
		{1, 1, 1}, {2, 2, 2}, {3, 3, 3},
	}
	for _, tt := range tests {
		testname := fmt.Sprintf("%d,%d", tt.a, tt.b)
		t.Run(testname, func(t *testing.T) {
			ans := IntMin(tt.a, tt.b)
			if ans != tt.want {
				t.Errorf("go end want ....")
			}
		})
	}
}
